#set(tableComment = table.tableComment)
#set(baseEntityClass = table.baseEntityClass())
#set(baseEntityPackage = table.baseEntityPackage())
#set(entityClass = table.entityClass())
#set(entityVar = table.entityVar())
#set(entityProxyClass = table.entityProxyClass())
#set(entityProxyVar = table.entityProxyVar())
package #(basePackage).#(table.moduleType).#(table.moduleName).#(table.domainName).entity;

import com.easy.query.core.annotation.Column;
import com.easy.query.core.annotation.EasyAlias;
import com.easy.query.core.annotation.EntityProxy;
import com.easy.query.core.annotation.Table;
import com.easy.query.core.proxy.ProxyEntityAvailable;

import lombok.*;
import java.util.*;
#for(column : columns)
#if(column.javaType == "BigDecimal")
import java.math.BigDecimal;
#end
#if(column.javaType == "LocalDateTime")
import java.time.LocalDateTime;
#end
#end
import #(baseEntityPackage);
import #(basePackage).#(table.moduleType).#(table.moduleName).#(table.domainName).entity.proxy.#(entityProxyClass);

/**
 * #(tableComment) 实体类
 *
 * @author #(table.author)
 * @since #(table.since())
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Table("#(table.tableName.toLowerCase())")
@EntityProxy
@EasyAlias("#(entityVar)")
public class #(table.className) extends #(baseEntityClass) implements ProxyEntityAvailable<#(entityClass), #(entityProxyClass)> {
    public static final String CACHE_TAG = "#(entityVar)";

### 特殊：树表专属逻辑
#if(table.templateType == 2 )
    public static final Long #(treeParentColumn_javaField_underlineCase.toUpperCase())_ROOT = 0L;

#end
#for(column : columns)
#if(!baseDOFields.contains(column.javaField)) ###排除 BaseDO 的字段
    /**
     * #(column.columnComment)
    #if (column.dictType != "")###处理枚举值
     *
     * 枚举 {TODO #(column.dictType) 对应的类}
    #end
     */
    #if(column.primaryKey)###处理主键
    @Column(primaryKey = true#if(column.javaType != 'String'), generatedKey = true#end)
    #end
    private #(column.javaType) #(column.javaField);
#end
#end
}